Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ByteTrack): Allow ByteTrack to track detection without class ids #1618

Conversation

Kadermiyanyedi
Copy link
Contributor

Description:
This PR modifies ByteTrack to handle detections that do not include a class_id, improving the flexibility of the tracking algorithm. In cases where models don’t return a class_id, ByteTrack will now assign a default internal ID to ensure continued tracking.

Key Changes:
Default class_id Assignment:

  • If class_id is missing from the detection, a default value of -5 is assigned to all detections.
  • If class_id is available, the algorithm uses it as normal.

This ensures that ByteTrack works seamlessly with models that do not provide class_id, without breaking existing functionality.

You can test the functionality with the provided Colab Notebook which demonstrates ByteTrack handling cases with and without class_id.

#1582

@Kadermiyanyedi Kadermiyanyedi force-pushed the allow-bytetrack-detection-without-class-ids branch from c0de341 to dbd4aa7 Compare October 23, 2024 19:05
@LinasKo
Copy link
Contributor

LinasKo commented Oct 23, 2024

Hey @Kadermiyanyedi 👋

Did you try checking what happens with the class_id after it's given to ByteTrack? I'm still super curious - maybe we can remove it altogether.

Is that something you'd have time for?

@LinasKo LinasKo added the hacktoberfest-accepted Contribute to the notion of open-source this October! label Oct 31, 2024
@LinasKo
Copy link
Contributor

LinasKo commented Oct 31, 2024

I suggested a special value other than -1 myself, but it does feel a bit arbitrary.

However, I'll take an unconventional approach and merge the PR, in hopes of finding a way to remove the need for classes entirely. If that fails, I'll come back and change the special value to something else.

Thank you @Kadermiyanyedi! Expect to see this in the next supervision release 😉

@LinasKo LinasKo merged commit ad4418a into roboflow:develop Oct 31, 2024
10 checks passed
@Kadermiyanyedi
Copy link
Contributor Author

@LinasKo Hi, due to the busy schedule, I missed your comment on the PR and forgot to reply—sorry about that. I tested your suggestion and confirmed that class IDs are not necessary; it works without them. I’m opening a PR for this right away. Would it be possible to revert the PR we merged?

@LinasKo
Copy link
Contributor

LinasKo commented Oct 31, 2024

✅ Reverted

@LinasKo LinasKo removed the hacktoberfest-accepted Contribute to the notion of open-source this October! label Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants